package com.study.app.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.study.app.mapper.StudentMapper;
import com.study.app.entity.Student;
import com.study.app.service.IStudentService;


@Service
public class StudentServiceImpl implements IStudentService 
{
    @Autowired(required=false)
    private StudentMapper studentMapper;

    //查询学生

    @Override
    public Student selectStudentById(Long id)
    {
        return studentMapper.selectStudentById(id);
    }

    //查询学生列表

    @Override
    public IPage<Student> selectStudentList(IPage<Student> page, Student student)
    {
        return studentMapper.selectStudentList(page,student);
    }

    //新增学生

    @Override
    public int insertStudent(Student student)
    {
        return studentMapper.insertStudent(student);
    }

    //修改学生

    @Override
    public int updateStudent(Student student)
    {
        return studentMapper.updateStudent(student);
    }

    //批量删除学生

    @Override
    public int deleteStudentByIds(Long[] ids)
    {
        return studentMapper.deleteStudentByIds(ids);
    }

    //删除学生信息

    @Override
    public int deleteStudentById(Long id)
    {
        return studentMapper.deleteStudentById(id);
    }
}
